<template>
	<view class="pb-safe-area">
		<view class="flex flex-column p-4 grid-gap-6" v-if="info.uid && info.mch">
			<view class="flex flex-column grid-gap-4" v-if="info.mch">
				<x-more status="nomore" nomore="所属商户" dashed></x-more>
				<view class="bg-white rounded-4 p-4">
					<x-shop-item :item="info.mch"></x-shop-item>
				</view>
			</view>
			<view class="flex flex-column grid-gap-4" v-if="info.shop">
				<x-more status="nomore" nomore="所属门店" dashed></x-more>
				<view class="bg-white rounded-4 p-4">
					<x-shop-item :item="info.shop"></x-shop-item>
				</view>
			</view>
		</view>
		<view class="flex flex-center vh-50" v-else>
			<x-empty type="order" text="您未与商户签约"></x-empty>
		</view>
		<x-loading v-if="loading" />
	</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { $api } from '@/utils'
const loading = ref(false)
const info = ref({})
const getInfo = () => {
	loading.value = true
	$api.Technician.shop().then(data => {
		info.value = data
	}).catch(() => { }).finally(() => {
		loading.value = false
	})
}
onLoad(() => {
	getInfo()
})
</script>